<style>
#dataTable1 pre{
	background-color:transparent;
	border:transparent;
}

#dataTable1_filter{
	display:none;
}
.Wdate{
	height:30px;
	width:250px;
}
#dataTable1{
	background:#ffffff;
}
</style>
<div class="row">
	<div class="col-lg-12">
		<h1 class="page-header">玩家常规日志</h1>
	</div>
	<!-- /.col-lg-12 -->
</div>

<div class="row" id="orderFilterForm">
	<div class="col-lg-6">
		<div class="panel panel-danger">
			<div class="panel-heading"> 筛选 </div>
			<div class="panel-body">
				<div id="block_playerId" class="form-group">
					<label>玩家Id</label>
					<input id="log_playerId" value="<?php echo $playerId?>" placeholder="" class="form-control" defaultVal=""/>
				</div>
				<div id="block_begintime" class="form-group">
					<label>开始时间</label>
					<input id="beginTime" placeholder="" class="form-control Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" defaultVal=""/>
				</div>
				<div id="block_endtime" class="form-group">
					<label>结束时间</label>
					<input id="endTime" placeholder="" class="form-control Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" defaultVal=""/>
				</div>
				<div id="block_type" class="form-group">
					<label>类型</label>
					<input id="log_type" placeholder="" class="form-control" defaultVal="" value="<?=@$logType?>"/>
				</div>
				<div class="col-lg-2">
					<button onclick="findSubmit()" type="button" class="btn btn-primary btn-lg">筛选</button>
				</div>
				<div class="col-lg-2">
					<button onclick="resetForm()" type="button" class="btn btn-warning btn-lg">清空</button>
				</div>
				<div class="col-lg-2">
					<button onclick="linkPage('admin/logCommon', {'logType':'聚宝盆'})" type="button" class="btn btn-success btn-lg">聚宝盆</button>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="row">
	<div class="col-lg-12">
		<div class="panel panel-default">
			<div class="panel-heading"> 玩家常规日志 </div>
			<div class="panel-body">
				<table width="100%" class="table table-striped table-bordered table-hover" id="dataTable1">
					<thead>
					<tr>
						<th>编号</th>
						<th>玩家id</th>
						<th>类型</th>
						<th>备注</th>
						<th>时间</th>
					</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>

<?php echo \Phalcon\Tag::javascriptInclude("js/My97DatePicker/WdatePicker.js"); ?>
<script>
var gTable1;
$(document).ready(function(){
    gTable1 = $('#dataTable1').DataTable({
			"processing": true,
    	"serverSide": true,
      "ajax": {
          "url": "/admin/ajaxLogCommon",
					"type": "POST",
          "data": function ( d ) {
              d.playerId = $("#log_playerId").val();
							d.beginTime = $("#beginTime").val();
							d.endTime = $("#endTime").val();
							d.type = $("#log_type").val();
          }
      },
		"columns": [
          { "data": "id" },
					{ "data": "player_id" },
					{ "data": "type" },
          { "data": "memo" },
          { "data": "create_time" }
        ],
		"pageLength": 25
	});

	$("#dataTable1_filter input[type=search]").attr('title', '（）中内容不支持搜索');
	
	$("#dataTable1").on('click', '.extrainfoBlk', function(){
		if($(this).find('pre').length > 0){
			$(this).find('.extrainfo').html($(this).find('pre').html());
		}
		else{
			$(this).find('.extrainfo').wrapInner('<pre></pre>');
		}
	});
});

function resetForm(){
	$("#orderFilterForm").find('input,select,textarea').each(function(){
		$(this).val($(this).attr('defaultVal'));
	});
}

function findSubmit(){
	gTable1.draw();
}
</script>